package com.runa.protocol.dto;

import com.runa.protocol.enums.ModbusFunctionCode;
import com.runa.protocol.enums.ModbusType;

abstract public class ModbusData implements IInterData{

    private ModbusType type;

    private int slaveId;

    private short transSign;

    private ModbusFunctionCode functionCode;

    protected byte[] data;

    ModbusData(ModbusType type, int slaveId, ModbusFunctionCode functionCode) {
        this.type = type;
        this.slaveId = slaveId;
        this.functionCode = functionCode;
    }

    public int getSlaveId() {
        return slaveId;
    }

    ModbusFunctionCode getFunctionCode() {
        return functionCode;
    }

    public void setData(byte[] data) {
        this.data = data;
    }

    public ModbusType getType() {
        return type;
    }

    public short getTransSign() {
        return transSign;
    }

    public void setTransSign(short transSign) {
        this.transSign = transSign;
    }
}
